//默认初始化
//就地初始化,声明成员变量时，直接给出初始值
//构造方法初始化

public class GirlFriend {
    public String name;
    public  int age;
   //就地初始化
    public String  name2="小美";
    public int age2 = 18;

    //构造方法
    public GirlFriend(String name,int age){
        this.name= name;
        this.age = age;
        System.out.println(name);
        System.out.println(age);
        System.out.println("这个构造方法被调用了");
    }

     public GirlFriend(){
       this("大美",19);//this(...)必须是第一条语句
     }

    public void eat(){
        System.out.println("我和"+name+"在吃饭...");
    }


    public void playGame(){
        System.out.println("我和"+name+"在玩游戏");
    }
}
